home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -screenplay- / otherstuff / jst_dev / installwizard / configinstall next >
Text File  |  1999-04-20  |  2KB  |  89 lines

  1. ; functions
  2.  
  3. ; setenv:
  4. ; #savemode: =0 writes to ENVARC: too
  5. ; #varname: name of the variable to affect
  6. ; #varvalue: required value
  7.  
  8. (procedure setenv #varname #varvalue
  9.   (
  10.    (run ("setenv %s \"%s\"" #varname #varvalue))
  11.   )
  12. )
  13.  
  14. ; get environment variables
  15.  
  16. (set #authorname (getenv "INSW/AUTHORNAME"))
  17. (set #authoremail (getenv "INSW/AUTHOREMAIL"))
  18. (set #editor (getenv "INSW/EDITOR"))
  19. (set #installroot (getenv "INSW/INSTALLROOT"))
  20. (set #loaderdevroot (getenv "INSW/LOADERDEVROOT"))
  21.  
  22. ; user prompts
  23.  
  24. (set #authorname
  25.     (askstring (prompt "What's your name ?")
  26.     (help 
  27.     "This name string will be used to author your installs/readmes\n"
  28.     "The general format is <firstname(s)> <name> (e.g: William H. Gates)")
  29.     (default #authorname)
  30.     )
  31. )
  32.  
  33. (set #authoremail
  34.     (askstring (prompt "What's your email address ?")
  35.     (help "This e-mail string will be used to author your readmes")
  36.     (default #authoremail)
  37.     )
  38. )
  39.  
  40. (set #editor
  41.     (askstring (prompt "What's your editor command/path ?")
  42.     (help "This editor will be used to edit readme and\n"
  43.       " to set default tool on developper text files")
  44.     (default #editor)
  45.     )
  46. )
  47.  
  48. (set #installroot
  49.     (askdir (prompt "Where should the user install files be generated ?")
  50.     (help "This dir will be used as a parent for your user install dirs")
  51.     (default #installroot)
  52.     )
  53. )
  54.  
  55. (set #loaderdevroot
  56.     (askdir (prompt "Where should the developper install files be generated ?")
  57.     (help "This dir will be used as a parent for your developper install dirs")
  58.     (default #loaderdevroot)
  59.     )
  60. )
  61.  
  62. (message ("\nYou selected the following:\n\nUser name: %s\nUser e-mail: %s\n\nUser install root: %s\nDevelopper install root: %s\n\nEditor to use: %s"
  63.            #authorname #authoremail #installroot #loaderdevroot #editor)
  64. )
  65.  
  66. (set #savemode
  67.      (askbool (prompt "Do you want to set the environment variables\n"
  68.                       "or to set them and save them (ENVARC:)?"
  69.                )
  70.               (help "Select \"Abort install\" to cancel everything")
  71.               (choices "Set only" "Set and save")
  72.       )
  73. )
  74.  
  75. (setenv "INSW/AUTHORNAME" #authorname)
  76. (setenv "INSW/AUTHOREMAIL" #authoremail)
  77. (setenv "INSW/EDITOR" #editor)
  78. (setenv "INSW/INSTALLROOT" #installroot)
  79. (setenv "INSW/LOADERDEVROOT" #loaderdevroot)
  80.  
  81. (if (= 0 #savemode) 
  82.   (
  83.    (makedir "ENVARC:INSW")
  84.    (copyfiles (help @copyfiles-help)
  85.        (source "ENV:INSW") (dest "ENVARC:INSW") (all)
  86.    )
  87.   )
  88. )
  89.